//
//  GongGaoDetailVC.m
//  智慧小区
//
//  Created by 高永杨 on 2017/3/18.
//  Copyright © 2017年 zhongchuang. All rights reserved.
//

#import "GongGaoDetailVC.h"
#import <MJRefresh.h>
#import "GongGaoModel.h"
#define messageUrl @"http://192.168.1.123:8080/gov/APPInfo/info.do"
@interface GongGaoDetailVC ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *autorLabel;

@end

@implementation GongGaoDetailVC
-(void)goBack
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self loadNewData];
    [self setNav:self];
    self.navigationItem.title = @"公告详情";
}
-(void)loadNewData
{
    NSMutableDictionary *muteDict = [NSMutableDictionary dictionary];
    [muteDict setValue:self.model.id_key forKey:@"id"];
    [muteDict setValue:self.model.typeFlag forKey:@"typeFlag"];
    [muteDict setValue:@"4" forKey:@"opt"];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    [manager GET:messageUrl parameters:muteDict progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        self.titleLabel.text = self.model.author;
        self.detailLabel.text = self.model.title;
        self.timeLabel.text = self.model.createTime;
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
